Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
Mac and OpenDoc are trademarks of Apple Computer, Inc.
Introduction
OpenDoc supports the Text Services Manager (TSM), and, in particular inline text input. OpenDoc does nothing special to support the TSMTE extension. So you have to do some additional work as for a current QuickDraw application which is using TextEdit with the TSMTE extension. The extension is named "Inline Support" in the English system with the Japanese Language Kit or "ÉCÉìÉâÉCÉìí«â¡ã@î\" in the Japanese system. It provides you the inline input in TextEdit easily.
What's TSMTE?
TSMTE is an extension to the Text Services Manager that does the second part of the work for you if you use TextEdit. It provides Apple event handlers that handle all interactions between an input method and TextEdit. The handlers are kept in the system heap, so they are shared between all applications. TSMTE can reduce the effort needed to implement inline input to a day or two. (See Technical Notes TE27 for the details)
General support
OpenDoc calls InitTSMAwareApp, CloseTSMAwareApp, TSMEvent, TSMMenuSelect, and SetTSMCursor at the appropriate times. Parts do not need to call any of these.
Inline input support
First, you need to specify the definition to include the TSMTE header file in your source code as follows. The header file is contained in the Developer CD.
#ifdef __TSMTE__
#include "TSMTE.h"
#endif
Parts wishing to use the TSMTE extension must check for its existence themselves.
long result;
if (Gestalt(kTSMTESignature, &result) == noErr &&
(result & (1 << gestaltTSMTE)) != 0)
// You can use TSMTE. Set the TSMTE available flag to kODTrue.
else
// You cannot use TSMTE. Set the TSMTE available flag to kODFalse.
After creating a text edit record by calling TENew or TEStyleNew, the part has to create a TSM document and enable the inline input by calling UseInputWindow API.